//by 略游 2021-04-20

//地图效果，每个玩家调用
//晚上，打开夜视则显示绿色，否则黑色
//白天，打开夜视则显示亮绿色，否则正常
if(!hasInterface)exitWith{};


//waitUntil{Sleep 10;!isNull (findDisplay 12 displayCtrl 51)};

(findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw", {
	
	//视角判断
	if(cameraView == "GUNNER"
	|| {cameraView == "GROUP"}) exitWith{};
	
	_night = (sunOrMoon < 0.5);

	//0-白天 1-夜视 2-热视觉
	_mod = currentVisionMode player;
	_color = "";
	_no_render = false;
	if(_mod == 0)then{
		if(_night)then{
			_color = "#(rgb,8,8,3)color(0,0,0,1)";
		}else{
			_no_render = true;
		};
	};
	
	if(_mod == 1)then{
		if(_night)then{
			_color = "#(rgb,8,8,3)color(0,0.65,0,0.5)";
		}else{
			_color = "#(rgb,8,8,3)color(0,0.85,0,1)";
		};
	};
	
	if(_mod == 2)then{
		if(_night)then{
			_color = "#(rgb,8,8,3)color(0.85,0.85,0.85,1.0)";
		}else{
			_color = "#(rgb,8,8,3)color(0.65,0.65,0.65,1.0)";
		};
	};
	
	if(_no_render) exitWith{};
	
	_half = worldSize * 0.5;
	(_this select 0) drawRectangle [
	[_half,_half],
	_half,
	_half,
	0,
	[1,1,1,1],
	_color];
}];

as_map_effect_inited = true;